home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
OWL
/
BORBTN1
/
BORBTN1.PAS
next >
Wrap
Pascal/Delphi Source File
|
1994-04-29
|
2KB
|
65 lines
{************************************************}
{ }
{ ObjectWindows Demo }
{ Copyright (c) 1992 by Borland International }
{ }
{************************************************}
program Step01b;
{Todd Kofford}
{913-832-0524}
uses WinTypes, WinProcs, OWindows, ODialogs, BWCC;
{$R BorBtn1}
type
PMyButton = ^TMyButton;
TMyButton = object(TButton)
function GetClassName: PChar; virtual;
procedure GetWindowClass(var AWndClass: TWndClass); virtual;
end;
PStepWindow = ^TStepWIndow;
TStepWindow = object(TWindow)
MyButton: PMyButton;
constructor Init(P: PWindowsObject; AName: PChar);
end;
TMyApplication = object(TApplication)
procedure InitMainWindow; virtual;
end;
constructor TStepWindow.Init(P: PWindowsObject; AName: PChar);
var
Red: array[0..2] of hBitMap;
begin
inherited Init(P, Aname);
Red[0] := LoadBitMap(hInstance, PChar(1101));
Red[1] := LoadBitMap(hInstance, PChar(3101));
Red[2] := LoadBitMap(hInstance, PChar(5101));
MyButton := New(PMyButton, Init(@Self, 101, 'Sam', 10, 10, 100, 100, False));
end;
function TMyButton.GetClassName: PChar;
begin
GetClassName := 'BorBtn';
end;
procedure TMyButton.GetWindowClass(var AWndClass: TWndClass);
begin
inherited GetWindowClass(AWndClass);
end;
procedure TMyApplication.InitMainWindow;
begin
MainWindow := New(PStepWindow, Init(nil, 'Steps'));
end;
var
MyApp: TMyApplication;
begin
MyApp.Init('Steps');
MyApp.Run;
MyApp.Done;
end.